<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="UTF-8">
    <title>test template</title>
    <script type="text/javascript" src="../static/template.js"></script>
</head>
<body>
<div id="content"></div>
<script type="text/html" id="test">
<h1>{{title}}</h1>
    {{include 'list'}}
</script>
<script type="text/html" id = 'list'>
<ul>
    {{each list as value i}}
    <li>索引 {{i+1}} : {{value}}</li>
    {{/each}}
</ul>
</script>
<script type="text/javascript">
    var data = {
        title:'嵌入模板',
        list:['文艺','博客','摄影','电影','民谣','旅行','吉他']
    };
    var html = template('test',data);
    document.getElementById('content').innerHTML = html;
</script>
</body>
</html>